unit uFunctions;

interface

function Gamma(AX: Extended): Extended;

implementation

uses Math;

function Gamma(AX: Extended): Extended;
begin
  //Stirling's approximation - http://en.wikipedia.org/wiki/Stirling%27s_approximation
  Result := power(2 * pi / AX, 0.5) * power(1 / exp(1) * (AX + 1 / (12 * AX - 1 / (10 * AX))), AX);
end;

end.
